<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:fo="http://www.w3.org/1999/XSL/Format" version="1.0">

    <!-- pour info
<xsl:template name="title.xref">
  <xsl:param name="target" select="."/>
  <xsl:choose>
    <xsl:when test="local-name($target) = 'figure'
                    or local-name($target) = 'example'
                    or local-name($target) = 'equation'
                    or local-name($target) = 'table'
                    or local-name($target) = 'dedication'
                    or local-name($target) = 'preface'
                    or local-name($target) = 'bibliography'
                    or local-name($target) = 'glossary'
                    or local-name($target) = 'index'
                    or local-name($target) = 'setindex'
                    or local-name($target) = 'colophon'">
      <xsl:call-template name="gentext.startquote"/>
      <xsl:apply-templates select="$target" mode="title.markup"/>
      <xsl:call-template name="gentext.endquote"/>
    </xsl:when>
    <xsl:otherwise>
      <fo:inline font-style="italic">
        <xsl:apply-templates select="$target" mode="title.markup"/>
      </fo:inline>
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>
-->

    <xsl:template match="*" mode="insert.title.markup">
        <xsl:param name="purpose" />
        <xsl:param name="xrefstyle" />
        <xsl:param name="title" />

        <xsl:choose>
            <!-- FIXME: what about the case where titleabbrev is inside the info? -->
            <xsl:when test="$purpose = 'xref' and titleabbrev">
                <xsl:apply-templates select="." mode="titleabbrev.markup" />
            </xsl:when>
            <xsl:when test="$purpose = 'xref'">
                <fo:inline font-style="italic">
                    <xsl:copy-of select="$title" />
                </fo:inline>
            </xsl:when>
            <xsl:otherwise>
                <xsl:copy-of select="$title" />
            </xsl:otherwise>
        </xsl:choose>
    </xsl:template>

</xsl:stylesheet>
